#include <cstdlib> // 包含 exit 函数的声明

namespace INVARIANT_CONDITION_UNREACH {
	enum status_codes {
		ST_UNKNOWN = -1,
		ST_SUCCESS,
		ST_INVALIDARG,
		ST_NOTFOUND,
		ST_FATAL,
	};

	extern void report_warn();
	extern void report_err();


	void report_status(int code)
	{
		if (code < 0) {
			exit(1);
		}
		if (code >= ST_FATAL) {
			report_err();
		}
		else {
			report_warn();
			if (code == ST_UNKNOWN) {
				exit(2);
			}
		}
	}
}